if(NOT ${LIB_PATH})
set(${LIB_PATH} /usr/lib})
endif(NOT ${LIB_PATH})

include_directories(. ../core)
include(FindPkgConfig)
include(FindCURL)

pkg_search_module(panel-applet REQUIRED libpanelapplet-2.0)
pkg_search_module(libnotify REQUIRED libnotify)

include_directories(${panel-applet_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${libnotify_INCLUDE_DIRS})
link_libraries(gbitly-applet ${panel-applet_LIBRARIES} ${CURL_LIBRARIES} ${libnotify_LIBRARIES} bitly)

configure_file(gBitLyApplet.server.template src/gui/gBitLyApplet.server)
configure_file(config.h.template src/gui/config.h)

add_executable(gbitly-applet gbitly-applet.c)
add_dependencies(gbitly-applet bitly)

install(TARGETS gbitly-applet
	RUNTIME DESTINATION bin
	)

install(FILES ui.xml bitly.png DESTINATION share/gbitly-applet)

install(FILES gBitLyApplet.server DESTINATION ${LIB_PATH}/bonobo/servers)
